home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / mcdsk340 / mdskdemo.bas < prev    next >
Encoding:
BASIC Source File  |  1997-01-15  |  1.9 KB  |  89 lines

  1. Attribute VB_Name = "MCDISKDEMO_BAS"
  2. Option Explicit
  3.  
  4. Public Const RandI = 32767
  5. Public Const RandL = 2147483647
  6. Public Const RandS = 1E+10!
  7. Public Const RandD = 1E+16
  8.  
  9. Public T2WDirInst       As String
  10. Public T2WDirTest       As String
  11. Public T2WFileTest      As String
  12.  
  13.  
  14. Public Sub sub_Load_Combo(Cmb As Control, strFile As String)
  15.  
  16.    Dim intStatus        As Integer
  17.    Dim strTmp           As String
  18.    
  19.    On Error GoTo ErrorLoadCombo
  20.    
  21.    Close #1
  22.    Open strFile For Input Shared As #1
  23.    
  24.    While Not EOF(1)
  25.       Line Input #1, strTmp
  26.       Cmb.AddItem strTmp
  27.    Wend
  28.    
  29.    Cmb.ListIndex = 0
  30.    
  31.    Exit Sub
  32.    
  33. ErrorLoadCombo:
  34.  
  35.    MsgBox ("File '" & strFile & "' can't be loaded !")
  36.    Resume Next
  37.  
  38. End Sub
  39.  
  40. Public Sub sub_Initialization()
  41.  
  42.    Dim intResult     As Integer
  43.    Dim lngResult     As Long
  44.    
  45.    T2WDirTest = T2WDirInst + "directory for testing"
  46.    T2WFileTest = "autoexec.bat"
  47.    
  48.    intResult = cMakeDir(T2WDirTest)
  49.    
  50.    lngResult = cFileCopy("c:\autoexec.bat", T2WDirTest + "\" + T2WFileTest)
  51.    
  52.    If (lngResult = True) Then
  53.       MsgBox "Can't copy file [" & T2WFileTest & "] in directory [" & T2WDirTest & "]"
  54.    End If
  55.    
  56.    intResult = cChDir(T2WDirTest)
  57.    
  58. End Sub
  59.  
  60. Public Sub sub_Check_Project()
  61.  
  62.    T2WDirInst = App.Path + "\"
  63.    
  64.    If (cFilePathExists(T2WDirInst + "MCDSK-32.VBP") = False) Then
  65.       MsgBox "'MC-DISK (32-Bit)' demo not found" & vbCrLf & vbCrLf & "Place all demo files in the same directory"
  66.    End If
  67.  
  68. End Sub
  69.  
  70. Public Sub sub_NextPrev(Cmb As Control, Index As Integer)
  71.    
  72.    Dim n          As Integer
  73.    Dim t          As Integer
  74.    
  75.    n = Cmb.ListIndex
  76.    t = Cmb.ListCount - 1
  77.    
  78.    If (Index = 0) Then
  79.       n = n - 1
  80.       If (n < 0) Then n = 0
  81.    Else
  82.       n = n + 1
  83.       If (n > t) Then n = t
  84.    End If
  85.    
  86.    Cmb.ListIndex = n
  87.    
  88. End Sub
  89.